<template>
  <div>
      <Banner
       :sightName="sightName"
       :bannerImg="bannerImg"
       :bannerImgs="gallaryImgs"/>
      <Header/>
      <div class="content">
      <list :list="list" />
      </div>
  </div>
</template>

<script>
import Banner from './components/Banner'
import Header from './components/Header'
import List from './components/List'
import axios from 'axios'
export default {
 name:'Detail',
 data () {
     return {
         sightName:'',
         bannerImg:'',
         gallaryImgs:[],
         list:[]
     }
 },
 components:{
     Banner,
     Header,
     List   
 } ,
 methods: {
    getDetailInfo () {
      // axios.get('/static/mock/detail.json', {
      axios.get('/mock/detail', {
        // params: {
        //   id: this.$route.params.id
        // }
      }).then(this.handleGetDataSucc)
    },
    handleGetDataSucc (res) {
      res = res.data.data
      if (res.ret && res.data) {
        const data = res.data
        this.sightName = data.sightName
        this.bannerImg = data.bannerImg
        this.gallaryImgs = data.gallaryImgs
        this.list = data.categoryList
      }
    }
  },
  mounted () {
    this.getDetailInfo()
  }
}
</script>

<style lang="stylus" scoped>
.content
    height:50rem
</style>